<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>3d和子旋转</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        section{
            width: 200px;
            height: 200px;
            perspective: 5000px;
            margin:300px auto;
        }
        div{
            width: 200px;
            height: 200px;
            perspective: 5000px;
            position: relative;
            transform-style: preserve-3d;
            transition: all 60s linear 0s ;
        }
        p{
            position: absolute;
            top: 0;
            left: 0;
            width: 200px;
            height: 200px;
         
        }
        p:nth-child(1){
            transform: rotateX(0)  translateZ(100px);
            background-color: rgba(23, 51, 212, 0.5)
        }
        p:nth-child(2){
            transform: rotateX(90deg) translateZ(100px);
            background-color: rgba(196, 23, 212, 0.5)
        }
        p:nth-child(3){
            transform: rotateX(-90deg) translateZ(100px);
            background-color: rgba(212, 177, 23, 0.5)
        }
        p:nth-child(4){
            transform: rotateX(180deg) translateZ(100px);
            background-color: rgba(23, 212, 51, 0.5)
        }
        p:nth-child(5){
            transform: rotatey(90deg) translateZ(100px);
            background-color: rgba(212, 23, 23, 0.5)
        }
        p:nth-child(){
            transform: rotatey(-90deg) translateZ(100px);
            background-color: rgba(23, 174, 212, 0.5)
        }
        div:hover{
            transform: rotateX(360deg) rotatey(360deg);
        }
    </style>
</head>
<body>
    <section>
    <div>
        <p></p>
        <p></p>
        <p></p>
        <p></p>
        <p></p>
        <p></p>
    </div>
    </section>
</body>
</html>